home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / CommResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  4.0 KB  |  121 lines  |  [TEXT/MMCC]

  1. /*
  2.      File:        CommResources.h
  3.  
  4.      Contains:    Communications Toolbox Resource Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __COMMRESOURCES__
  21. #define __COMMRESOURCES__
  22.  
  23.  
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27. /*    #include <Types.h>                                            */
  28. /*        #include <ConditionalMacros.h>                            */
  29. /*    #include <MixedMode.h>                                        */
  30. /*    #include <Memory.h>                                            */
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. #if PRAGMA_ALIGN_SUPPORTED
  37. #pragma options align=mac68k
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT_SUPPORTED
  41. #pragma import on
  42. #endif
  43.  
  44.  
  45. enum {
  46. /*    tool classes (also the tool file types)    */
  47.     classCM                        = 'cbnd',
  48.     classFT                        = 'fbnd',
  49.     classTM                        = 'tbnd'
  50. };
  51.  
  52. enum {
  53. /*    version of the Comm Resource Manager    */
  54.     curCRMVersion                = 2,
  55. /* constants general to the use of the Communications Resource Manager */
  56.     crmType                        = 9,                            /* queue type    */
  57.     crmRecVersion                = 1,                            /* version of queue structure */
  58. /*    error codes */
  59.     crmGenericError                = -1,
  60.     crmNoErr                    = 0
  61. };
  62.  
  63. /* data structures general to the use of the Communications Resource Manager */
  64. typedef OSErr CRMErr;
  65.  
  66. struct CRMRec {
  67.     QElemPtr                        qLink;                        /*reserved*/
  68.     short                            qType;                        /*queue type -- ORD(crmType) = 9*/
  69.     short                            crmVersion;                    /*version of queue element data structure*/
  70.     long                            crmPrivate;                    /*reserved*/
  71.     short                            crmReserved;                /*reserved*/
  72.     long                            crmDeviceType;                /*type of device, assigned by DTS*/
  73.     long                            crmDeviceID;                /*device ID; assigned when CRMInstall is called*/
  74.     long                            crmAttributes;                /*pointer to attribute block*/
  75.     long                            crmStatus;                    /*status variable - device specific*/
  76.     long                            crmRefCon;                    /*for device private use*/
  77. };
  78. typedef struct CRMRec CRMRec;
  79.  
  80. typedef CRMRec *CRMRecPtr;
  81.  
  82. extern pascal CRMErr InitCRM(void);
  83. extern pascal QHdrPtr CRMGetHeader(void);
  84. extern pascal void CRMInstall(CRMRecPtr crmReqPtr);
  85. extern pascal OSErr CRMRemove(CRMRecPtr crmReqPtr);
  86. extern pascal CRMRecPtr CRMSearch(CRMRecPtr crmReqPtr);
  87. extern pascal short CRMGetCRMVersion(void);
  88. extern pascal Handle CRMGetResource(ResType theType, short theID);
  89. extern pascal Handle CRMGet1Resource(ResType theType, short theID);
  90. extern pascal Handle CRMGetIndResource(ResType theType, short index);
  91. extern pascal Handle CRMGet1IndResource(ResType theType, short index);
  92. extern pascal Handle CRMGetNamedResource(ResType theType, ConstStr255Param name);
  93. extern pascal Handle CRMGet1NamedResource(ResType theType, ConstStr255Param name);
  94. extern pascal void CRMReleaseResource(Handle theHandle);
  95. extern pascal Handle CRMGetToolResource(short procID, ResType theType, short theID);
  96. extern pascal Handle CRMGetToolNamedResource(short procID, ResType theType, ConstStr255Param name);
  97. extern pascal void CRMReleaseToolResource(short procID, Handle theHandle);
  98. extern pascal long CRMGetIndex(Handle theHandle);
  99. extern pascal short CRMLocalToRealID(ResType bundleType, short toolID, ResType theType, short localID);
  100. extern pascal short CRMRealToLocalID(ResType bundleType, short toolID, ResType theType, short realID);
  101. extern pascal OSErr CRMGetIndToolName(OSType bundleType, short index, Str255 toolName);
  102. extern pascal OSErr CRMFindCommunications(short *vRefNum, long *dirID);
  103. extern pascal Boolean CRMIsDriverOpen(ConstStr255Param driverName);
  104. extern pascal CRMErr CRMParseCAPSResource(Handle theHandle, ResType selector, unsigned long *value);
  105. extern pascal OSErr CRMReserveRF(short refNum);
  106. extern pascal OSErr CRMReleaseRF(short refNum);
  107.  
  108. #if PRAGMA_IMPORT_SUPPORTED
  109. #pragma import off
  110. #endif
  111.  
  112. #if PRAGMA_ALIGN_SUPPORTED
  113. #pragma options align=reset
  114. #endif
  115.  
  116. #ifdef __cplusplus
  117. }
  118. #endif
  119.  
  120. #endif /* __COMMRESOURCES__ */
  121.